package com.freemypay.java.十二通过异常处理错误.八finally清理.二return中使用finally;

public class MultipleReturns {
	public static void f(int i) {
		System.out.println("Initialization that requires cleanup");
		try {
			System.out.println("Point 1");
			if(i == 1) return;
			System.out.println("Point 2");
			if(i == 2) return;
			System.out.println("Point 3");
			if(i == 3) return;
			System.out.println("end");
			return;
		} finally {
			// TODO: handle finally clause
			System.out.println("Performing cleanup");
		}
	}

	public static void main(String[] args) {
		for (int i = 0; i <= 4; i++) {
			f(i);
		}
	}
}
